<!DOCTYPE html>
<html lang="en">
<head>
 {{template "pc/public/mycss.html" .}}
</head>
<style type="text/css">
	#wrapper{
		background: #f5f5f5!important;
	}
	.header-center{
		background: #fff;
	}
	.user_left{
		background: #fff;
	}
	.fenlei{
		width: 20%;
	}
	
	@media (max-width: 992px){
		.fenlei{
		    width: 100%;
		}
	}
	.process-eva {
    	padding-top: 0;
	}	
	.add{background-image: url(/static/pc/img/add.png);background-repeat: no-repeat;background-position: center;background-size: 100%;}
	#up {
    color: #fff;
    background: #f23636;
    border: none;
    margin: auto;
    margin-top: 20px;
    width: 180px;
    height: 35px;
    line-height: 35px;
    display: block;
}
.alleva{padding-bottom: 0 !important;}
.adminsetup {padding-bottom: 20px;}
</style>
<body class="common-home res layout-home1">
<div id="wrapper" class="wrapper-full banners-effect-7">
	<!-- Header Container  -->
    {{template "pc/public/head.html" .}}
  	{{template "pc/public/mytop.html" .}}
	<div class="main-container container">
		<div class="row mb-50">
			<!--Left Part Start -->
			{{template "pc/public/myleft.html" .}}
			<!--Middle Part Start-->
			<div id="content" class="col-md-10 col-sm-8 right mt-15">
				<div class="adminsetup ">
					<h1>商品评价
						<!-- <a href="" class="fs-12 fr" style="font-weight: 400;">前往查看</a>
						<span class="fs-12 fr mr-20" style="font-weight: 400;">卖家：<a href="" style="color: #e54242; font-weight: bold;">小王小王</a></span>  -->
					</h1>
					<form>
					<div class="shopeve">
						{{range .shopcar}}
						<div class="evalist">
							<input type="hidden" name="cid" value="{{.id}}">
							<div class="spimg">
								<img class="pic" src="{{.pathname}}">
								<div class="spdetails">
									<p class="overpl3">{{.title}}</p>
									<!-- <span class="fs-12 c-999 overpl2">内容内容内容内容内容内容内容内容内容</span> -->
								</div>
							</div>
							<div class="process-eva">
								<div class="process-right">	
									<p>
										商品评分
										<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="1">
										<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="2">
										<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="3">
										<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="4">
										<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="5">
										<span></span>
										<input type="hidden" name="score">
									</p>
									<!-- <p>卖家服务
										<img src="../../img/pc/comment_14.png">
										<img src="../../img/pc/comment_14.png">
										<img src="../../img/pc/comment_14.png">
										<img src="../../img/pc/comment_14.png">
										<img src="../../img/pc/comment_14.png">
										<span></span>
									</p>
									<p>物流服务
										<img src="../../img/pc/comment_14.png">
										<img src="../../img/pc/comment_14.png">
										<img src="../../img/pc/comment_14.png">
										<img src="../../img/pc/comment_14.png">
										<img src="../../img/pc/comment_14.png">
										<span></span>
									</p> -->
								</div>
								<div class="process-left">
									<div><span>评价商品</span><textarea name="content"></textarea></div>
									<div>
										<span>晒照片</span>
										<div class="sun-photo">
											<span class="add">
												<input type="file" onchange='sword_uppic(this,"evaluation")' accept="image/*">
												<input type="hidden" name="imgs">
											</span>
											<span class="add">
												<input type="file" onchange='sword_uppic(this,"evaluation")' accept="image/*">
												<input type="hidden" name="imgs">
											</span>
											<span class="add">
												<input type="file" onchange='sword_uppic(this,"evaluation")' accept="image/*">
												<input type="hidden" name="imgs">
											</span>
											<input type="hidden" name="img">
										</div>
									</div>
								</div>
							</div>
						</div>
						{{end}}
					</div>
					<div class="alleva">
						<div class="process-eva" style="background: #fff;">
							<div class="process-right">	
								<p>物流服务
									<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="1">
									<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="2">
									<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="3">
									<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="4">
									<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="5">
									<span></span>
									<input type="hidden" name="shop_logisticsscore">
								</p>
								<p>服务态度
									<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="1">
									<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="2">
									<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="3">
									<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="4">
									<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/pc/img/pc/comment_14.png" class="score_img" data-num="5">
									<span></span>
									<input type="hidden" name="shop_score">
								</p>
							</div>
						</div>
					</div>
					</form>
						<button id="up">提交评价</button>
				</div>
			</div>
		</div>
	</div>
</div>

<!-- Footer Container -->
<!-- Footer Container -->
{{template "pc/public/foot.html" .}}
{{template "pc/public/myfoot.html" .}}
<script type="text/javascript" src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/sword_uppic.js"></script>
<script type="text/javascript">
	$('.score_img').click(function(){
    	var num=$(this).attr('data-num')
    	$(this).parent().children().each(function(){
    		var nname=this.nodeName
    		if(nname=='INPUT'){
    			this.value=num
    		}else{
    			var num2=this.getAttribute('data-num')
    			if(num2<=num){
    				this.src='/static/pc/img/pc/comment_15.png'
    			}else{
    				this.src='/static/pc/img/pc/comment_14.png'
    			}
    		}
    	})
	})
	$('#up').click(function(){
		$('.evalist').each(function(){
	 		var va=''
	 		$(this).find('input[name="imgs"]').each(function(){
	 			if($(this).val()!=""){
	 				va+=","+$(this).val()
	 			}
	 		})
	 		$(this).find('input[name="img"]').val(va)
	 	})
	 	$('input[name="score"]').each(function(){
	 		if(!this.value){
	 			showToast('请给产品打分~')
	 			status=0
	 			return false;
	 		}
	 	})
	 	if(!$('input[name="shop_logisticsscore"]').val()){
	 		showToast('请给店铺打分~')
 			return false;
	 	}
	 	if(!$('input[name="shop_score"]').val()){
	 		showToast('请给店铺打分~')
 			return false;
	 	}	
	 	var that=this
		that.disabled=true
	 	var form=$('form').serialize()
	 	$.ajax({
	 		url:window.location.href, 
	 		data:form,
 			type:'post',
 			success:function(res){
	 			if(res){
	 				wxc.xcConfirm("评价成功","info",{onClose:function(){
	           		 	window.location.href=document.referrer
      				}})
		 		}else{
		 			showToast('网络繁忙,请稍后再试~')
		 		}
		 		that.disabled=false
	 		},error:function(){
	 			showToast('网络繁忙,请稍后再试~')
	 			that.disabled=false
	 		}
	 	})
	})
</script>
</body>
</html>
